package wiki.generic.concretemed;

import wiki.generic.med.GeneralPurposeService;
import wiki.generic.utilities.ExtensionController;
import wiki.generic.utilities.FileNameKeeper;
import wiki.generic.utilities.FileNamesManager;
import wiki.generic.utilities.FormatUnsupportedException;
import wiki.generic.utilities.TextChanger;
/**
 * 
 * @author <p><strong>JwTeam</strong></p> 
 *
 */
public class GeneralPurposeServiceMediator implements GeneralPurposeService{
	

	private FileNameKeeper fnk;
	private ExtensionController excontr;
	private TextChanger tchanger;
	private FileNamesManager fnm;
	private TextChanger htmlchanger;
	
	
	public GeneralPurposeServiceMediator(
			FileNameKeeper fnk, ExtensionController excontr,TextChanger htmlchanger, FileNamesManager fnm, TextChanger tchanger) {
		super();
		this.fnk = fnk;
		this.excontr = excontr;
		this.htmlchanger=htmlchanger;
		this.fnm=fnm;
		this.tchanger=tchanger;
	
	}

	public String getFileName (String path){
		return fnk.getFileName(path);
	}
	
	public String getFileType(String path) throws FormatUnsupportedException{
		return excontr.getFileType(path);
	}

	@Override
	public String getExtension(String fname) {
		return excontr.getExtension(fname);
	}

	@Override
	public String changeInputText(String text){
		return tchanger.changeText(text);
	}

	@Override
	public String modifyName(String fileName) {
		return fnm.modifyName(fileName);
	}

	@Override
	public boolean isDuplicate(String dest, String fileName) {
		return fnm.isDuplicate(dest, fileName);
	}
	
	public String changeHTMLText(String text){
		return htmlchanger.changeText(text);
	}
	

}

